Integrand size = 18, antiderivative size = 118 \[ \int \frac {x^2}{c+\frac {a}{x^2}+\frac {b}{x}} \, dx=\frac {\left (b^2-a c\right ) x}{c^3}-\frac {b x^2}{2 c^2}+\frac {x^3}{3 c}-\frac {\left (b^4-4 a b^2 c+2 a^2 c^2\right ) \text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c^4 \sqrt {b^2-4 a c}}-\frac {b \left (b^2-2 a c\right ) \log \left (a+b x+c x^2\right )}{2 c^4} \]
[Out]
Time = 0.07 (sec) , antiderivative size = 118, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {1368, 715, 648, 632, 212, 642} \[ \int \frac {x^2}{c+\frac {a}{x^2}+\frac {b}{x}} \, dx=-\frac {\left (2 a^2 c^2-4 a b^2 c+b^4\right ) \text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c^4 \sqrt {b^2-4 a c}}-\frac {b \left (b^2-2 a c\right ) \log \left (a+b x+c x^2\right )}{2 c^4}+\frac {x \left (b^2-a c\right )}{c^3}-\frac {b x^2}{2 c^2}+\frac {x^3}{3 c} \]
[In]
[Out]
Rule 212
Rule 632
Rule 642
Rule 648
Rule 715
Rule 1368
Rubi steps \begin{align*} \text {integral}& = \int \frac {x^4}{a+b x+c x^2} \, dx \\ & = \int \left (\frac {b^2-a c}{c^3}-\frac {b x}{c^2}+\frac {x^2}{c}-\frac {a \left (b^2-a c\right )+b \left (b^2-2 a c\right ) x}{c^3 \left (a+b x+c x^2\right )}\right ) \, dx \\ & = \frac {\left (b^2-a c\right ) x}{c^3}-\frac {b x^2}{2 c^2}+\frac {x^3}{3 c}-\frac {\int \frac {a \left (b^2-a c\right )+b \left (b^2-2 a c\right ) x}{a+b x+c x^2} \, dx}{c^3} \\ & = \frac {\left (b^2-a c\right ) x}{c^3}-\frac {b x^2}{2 c^2}+\frac {x^3}{3 c}-\frac {\left (b \left (b^2-2 a c\right )\right ) \int \frac {b+2 c x}{a+b x+c x^2} \, dx}{2 c^4}+\frac {\left (b^4-4 a b^2 c+2 a^2 c^2\right ) \int \frac {1}{a+b x+c x^2} \, dx}{2 c^4} \\ & = \frac {\left (b^2-a c\right ) x}{c^3}-\frac {b x^2}{2 c^2}+\frac {x^3}{3 c}-\frac {b \left (b^2-2 a c\right ) \log \left (a+b x+c x^2\right )}{2 c^4}-\frac {\left (b^4-4 a b^2 c+2 a^2 c^2\right ) \text {Subst}\left (\int \frac {1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{c^4} \\ & = \frac {\left (b^2-a c\right ) x}{c^3}-\frac {b x^2}{2 c^2}+\frac {x^3}{3 c}-\frac {\left (b^4-4 a b^2 c+2 a^2 c^2\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c^4 \sqrt {b^2-4 a c}}-\frac {b \left (b^2-2 a c\right ) \log \left (a+b x+c x^2\right )}{2 c^4} \\ \end{align*}
Time = 0.07 (sec) , antiderivative size = 112, normalized size of antiderivative = 0.95 \[ \int \frac {x^2}{c+\frac {a}{x^2}+\frac {b}{x}} \, dx=\frac {c x \left (6 b^2-6 a c-3 b c x+2 c^2 x^2\right )+\frac {6 \left (b^4-4 a b^2 c+2 a^2 c^2\right ) \arctan \left (\frac {b+2 c x}{\sqrt {-b^2+4 a c}}\right )}{\sqrt {-b^2+4 a c}}-3 \left (b^3-2 a b c\right ) \log (a+x (b+c x))}{6 c^4} \]
[In]
[Out]
Time = 0.12 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.08
method | result | size |
default | \(-\frac {-\frac {1}{3} c^{2} x^{3}+\frac {1}{2} b c \,x^{2}+a c x -b^{2} x}{c^{3}}+\frac {\frac {\left (2 a b c -b^{3}\right ) \ln \left (c \,x^{2}+b x +a \right )}{2 c}+\frac {2 \left (c \,a^{2}-b^{2} a -\frac {\left (2 a b c -b^{3}\right ) b}{2 c}\right ) \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}}}{c^{3}}\) | \(128\) |
risch | \(\text {Expression too large to display}\) | \(1138\) |
[In]
[Out]
none
Time = 0.31 (sec) , antiderivative size = 383, normalized size of antiderivative = 3.25 \[ \int \frac {x^2}{c+\frac {a}{x^2}+\frac {b}{x}} \, dx=\left [\frac {2 \, {\left (b^{2} c^{3} - 4 \, a c^{4}\right )} x^{3} - 3 \, {\left (b^{3} c^{2} - 4 \, a b c^{3}\right )} x^{2} + 3 \, {\left (b^{4} - 4 \, a b^{2} c + 2 \, a^{2} c^{2}\right )} \sqrt {b^{2} - 4 \, a c} \log \left (\frac {2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c - \sqrt {b^{2} - 4 \, a c} {\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) + 6 \, {\left (b^{4} c - 5 \, a b^{2} c^{2} + 4 \, a^{2} c^{3}\right )} x - 3 \, {\left (b^{5} - 6 \, a b^{3} c + 8 \, a^{2} b c^{2}\right )} \log \left (c x^{2} + b x + a\right )}{6 \, {\left (b^{2} c^{4} - 4 \, a c^{5}\right )}}, \frac {2 \, {\left (b^{2} c^{3} - 4 \, a c^{4}\right )} x^{3} - 3 \, {\left (b^{3} c^{2} - 4 \, a b c^{3}\right )} x^{2} - 6 \, {\left (b^{4} - 4 \, a b^{2} c + 2 \, a^{2} c^{2}\right )} \sqrt {-b^{2} + 4 \, a c} \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) + 6 \, {\left (b^{4} c - 5 \, a b^{2} c^{2} + 4 \, a^{2} c^{3}\right )} x - 3 \, {\left (b^{5} - 6 \, a b^{3} c + 8 \, a^{2} b c^{2}\right )} \log \left (c x^{2} + b x + a\right )}{6 \, {\left (b^{2} c^{4} - 4 \, a c^{5}\right )}}\right ] \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 498 vs. \(2 (110) = 220\).
Time = 0.60 (sec) , antiderivative size = 498, normalized size of antiderivative = 4.22 \[ \int \frac {x^2}{c+\frac {a}{x^2}+\frac {b}{x}} \, dx=- \frac {b x^{2}}{2 c^{2}} + x \left (- \frac {a}{c^{2}} + \frac {b^{2}}{c^{3}}\right ) + \left (\frac {b \left (2 a c - b^{2}\right )}{2 c^{4}} - \frac {\sqrt {- 4 a c + b^{2}} \cdot \left (2 a^{2} c^{2} - 4 a b^{2} c + b^{4}\right )}{2 c^{4} \cdot \left (4 a c - b^{2}\right )}\right ) \log {\left (x + \frac {- 3 a^{2} b c + a b^{3} + 4 a c^{4} \left (\frac {b \left (2 a c - b^{2}\right )}{2 c^{4}} - \frac {\sqrt {- 4 a c + b^{2}} \cdot \left (2 a^{2} c^{2} - 4 a b^{2} c + b^{4}\right )}{2 c^{4} \cdot \left (4 a c - b^{2}\right )}\right ) - b^{2} c^{3} \left (\frac {b \left (2 a c - b^{2}\right )}{2 c^{4}} - \frac {\sqrt {- 4 a c + b^{2}} \cdot \left (2 a^{2} c^{2} - 4 a b^{2} c + b^{4}\right )}{2 c^{4} \cdot \left (4 a c - b^{2}\right )}\right )}{2 a^{2} c^{2} - 4 a b^{2} c + b^{4}} \right )} + \left (\frac {b \left (2 a c - b^{2}\right )}{2 c^{4}} + \frac {\sqrt {- 4 a c + b^{2}} \cdot \left (2 a^{2} c^{2} - 4 a b^{2} c + b^{4}\right )}{2 c^{4} \cdot \left (4 a c - b^{2}\right )}\right ) \log {\left (x + \frac {- 3 a^{2} b c + a b^{3} + 4 a c^{4} \left (\frac {b \left (2 a c - b^{2}\right )}{2 c^{4}} + \frac {\sqrt {- 4 a c + b^{2}} \cdot \left (2 a^{2} c^{2} - 4 a b^{2} c + b^{4}\right )}{2 c^{4} \cdot \left (4 a c - b^{2}\right )}\right ) - b^{2} c^{3} \left (\frac {b \left (2 a c - b^{2}\right )}{2 c^{4}} + \frac {\sqrt {- 4 a c + b^{2}} \cdot \left (2 a^{2} c^{2} - 4 a b^{2} c + b^{4}\right )}{2 c^{4} \cdot \left (4 a c - b^{2}\right )}\right )}{2 a^{2} c^{2} - 4 a b^{2} c + b^{4}} \right )} + \frac {x^{3}}{3 c} \]
[In]
[Out]
Exception generated. \[ \int \frac {x^2}{c+\frac {a}{x^2}+\frac {b}{x}} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.28 (sec) , antiderivative size = 113, normalized size of antiderivative = 0.96 \[ \int \frac {x^2}{c+\frac {a}{x^2}+\frac {b}{x}} \, dx=\frac {2 \, c^{2} x^{3} - 3 \, b c x^{2} + 6 \, b^{2} x - 6 \, a c x}{6 \, c^{3}} - \frac {{\left (b^{3} - 2 \, a b c\right )} \log \left (c x^{2} + b x + a\right )}{2 \, c^{4}} + \frac {{\left (b^{4} - 4 \, a b^{2} c + 2 \, a^{2} c^{2}\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{\sqrt {-b^{2} + 4 \, a c} c^{4}} \]
[In]
[Out]
Time = 8.29 (sec) , antiderivative size = 151, normalized size of antiderivative = 1.28 \[ \int \frac {x^2}{c+\frac {a}{x^2}+\frac {b}{x}} \, dx=\frac {x^3}{3\,c}-x\,\left (\frac {a}{c^2}-\frac {b^2}{c^3}\right )-\frac {b\,x^2}{2\,c^2}+\frac {\ln \left (c\,x^2+b\,x+a\right )\,\left (8\,a^2\,b\,c^2-6\,a\,b^3\,c+b^5\right )}{2\,\left (4\,a\,c^5-b^2\,c^4\right )}+\frac {\mathrm {atan}\left (\frac {b}{\sqrt {4\,a\,c-b^2}}+\frac {2\,c\,x}{\sqrt {4\,a\,c-b^2}}\right )\,\left (2\,a^2\,c^2-4\,a\,b^2\,c+b^4\right )}{c^4\,\sqrt {4\,a\,c-b^2}} \]
[In]
[Out]